﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="Banner.ascx.cs" Inherits="Banner" %>
<%@ Import Namespace="System.Linq" %>

<div class="banner">

    <%
        BieumauDataContext db = new BieumauDataContext();
        tblBanner bn = null;
        try
        {
            bn = db.tblBanners.Single(p => p.Vitri == 1 && p.Trangthai == true);
        }
        catch { }
        if(bn!=null)
        {
        if (bn.Loaifile.Trim()== "swf")
        {
    %>
        <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="100%" height="165">
      <param name="movie" value="<%=bn.URL%>" />
      <param name="quality" value="high" />

<embed src="<%=bn.URL%>" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="100%" height="165"></embed>
    </object>
    <%
        }
        else
        {
            %>
             <img src="<%=bn.URL%>" width="100%" height="165" />
           
    <%
        }
        }
    %>
    


</div>